<?php
/*
 * Forescore
 * A golf scoring and analysis app
 * 
 * @license   MIT License
 * @package   Forescore
 * @author    $Author: brian@brianvoss.com $
 * @version   $Id: index.php 12 2013-06-28 03:28:14Z brian@brianvoss.com $
 * @lastrevision   $Date: 2013-06-28 03:28:14 +0000 (Fri, 28 Jun 2013) $
 * @filesource     $URL: http://forescore.googlecode.com/svn/trunk/public/index.php $
 */

// Define path to application directory
defined('APPLICATION_PATH')
    || define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/../application'));

// Define application environment
defined('APPLICATION_ENV')
    || define('APPLICATION_ENV', (getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : 'development'));

// Ensure library/ is on include_path
set_include_path(implode(PATH_SEPARATOR, array(
    realpath(APPLICATION_PATH . '/../library'),
    get_include_path(),
)));

require_once 'Zend/Loader/Autoloader.php';
$autoloader = Zend_Loader_Autoloader::getInstance();
$autoloader->setFallbackAutoloader(true);

// Create application, bootstrap, and run
$application = new Zend_Application(
    APPLICATION_ENV,
    APPLICATION_PATH . '/configs/application.ini'
);
$application->bootstrap()
            ->run();